package cn.lei.uicontrols;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ArrayAdapter;
import android.widget.GridView;

public class AtyUsingGridView extends AppCompatActivity {

    private ArrayAdapter<String> mAdapter;
    private GridView mGridView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_aty_using_grid_view);

        mAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1);

        mGridView = (GridView) findViewById(R.id.gridView);
        mGridView.setAdapter(mAdapter);

        for (int i = 0; i < 60; i++) {
            mAdapter.add("hello" + i);
        }
    }
}
